package cn.iocoder.yudao.module.design.dal.mysql.projectmanager;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.design.controller.admin.projectmanager.vo.ProjectManagerExportReqVO;
import cn.iocoder.yudao.module.design.controller.admin.projectmanager.vo.ProjectManagerPageReqVO;
import cn.iocoder.yudao.module.design.dal.dataobject.projectmanager.ProjectManagerDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 认证项目经理 Mapper
 *
 * @author czw
 */
@Mapper
public interface ProjectManagerMapper extends BaseMapperX<ProjectManagerDO> {

    default PageResult<ProjectManagerDO> selectPage(ProjectManagerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProjectManagerDO>()
                .eqIfPresent(ProjectManagerDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ProjectManagerDO::getWorkCd, reqVO.getWorkCd())
                .eqIfPresent(ProjectManagerDO::getShowId, reqVO.getShowId())
                .eqIfPresent(ProjectManagerDO::getNomalPrice, reqVO.getNomalPrice())
                .betweenIfPresent(ProjectManagerDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ProjectManagerDO::getRemark, reqVO.getRemark())
                .orderByDesc(ProjectManagerDO::getId));
    }

    default List<ProjectManagerDO> selectList(ProjectManagerExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ProjectManagerDO>()
                .eqIfPresent(ProjectManagerDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ProjectManagerDO::getWorkCd, reqVO.getWorkCd())
                .eqIfPresent(ProjectManagerDO::getShowId, reqVO.getShowId())
                .eqIfPresent(ProjectManagerDO::getNomalPrice, reqVO.getNomalPrice())
                .betweenIfPresent(ProjectManagerDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ProjectManagerDO::getRemark, reqVO.getRemark())
                .orderByDesc(ProjectManagerDO::getId));
    }

}
